CachedSharePointFile Class

A file which exists in a SharePoint document library, and is cached locally for faster access. The file may be read, but the file is not opened or its contents processed.

Namespace: Microsoft.LearningComponents.SharePoint

Assembly: Microsoft.LearningComponents.SharePoint.dll

Syntax
C#

public class CachedSharePointFile : IDisposable

Constructors
Name Description
Ð CachedSharePointFile (SharePointCacheSettings, SharePointFileLocation)

Create a cached copy of a file in SharePoint.

Ð CachedSharePointFile (SharePointCacheSettings, SharePointFileLocation, bool)

Create a representation of a file in SharePoint, running with elevated privileges when accessing the SharePoint file.

Properties
Name Description
Ð FileName

Gets the file name of the file being cached. This method requires

Methods
Name Description
Ð Dispose ()

This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Releases all resources used by the CachedSharePointFile.

Ï Dispose (bool)

Releases all resources used by this object

Ð GetFileStream

Gets the file as a stream.

Ð TransmitFile

Writes the file directly to the response.

Remarks

CachedSharePointFile implements IDisposable. Always call the Dispose method when finished with a CachedSharePointFile object, or use a using statement, to ensure that unmanaged resources are explicitly and properly released.